package dao.oc_property_tools_ice;
import java.util.ArrayList;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import entitybean.oc_property_ice.EntityBean_Oc_Property_Ice;
import entitybean.oc_property_tools_ice.EntityBean_Oc_Property_Tools_Ice;
public class DaoImpl_Oc_Property_Tools_Ice  extends HibernateDaoSupport implements Dao_Oc_Property_Tools_Ice{
	public void Insert_Oc_Property_Tools_Ice(EntityBean_Oc_Property_Tools_Ice e)
	{
		this.getHibernateTemplate().save(e);
	}
	public void Update_Oc_Property_Tools_Ice(EntityBean_Oc_Property_Tools_Ice e)
	{
		this.getHibernateTemplate().update(e);
	}
	@SuppressWarnings("unchecked")
	public void Delete_Oc_Property_Tools_Ice(String id)
	{
		List<EntityBean_Oc_Property_Tools_Ice> list=
			this.getHibernateTemplate().find("from EntityBean_Oc_Property_Tools_Ice where del='OFF' and id in("+id+")");	
		for(int i=0;i<list.size();i++)
		{
			EntityBean_Oc_Property_Tools_Ice e=list.get(i);
			e.setDel("ON");
			this.getHibernateTemplate().update(e);
			
		}
	}
	@SuppressWarnings("unchecked")
	public EntityBean_Oc_Property_Tools_Ice Find_EntityBean_Oc_Property_Tools_Ice(
			Integer id) {
		EntityBean_Oc_Property_Tools_Ice e=new EntityBean_Oc_Property_Tools_Ice();
		List<EntityBean_Oc_Property_Tools_Ice> list=
			this.getHibernateTemplate().find("from EntityBean_Oc_Property_Tools_Ice where id="+id);
		if(list.size()>0)
		{
			e=list.get(0);
		}
		return e;
	}
	@SuppressWarnings("unchecked")
	public List<EntityBean_Oc_Property_Tools_Ice> Find_EntityBean_Oc_Property_Tools_Ice() {
		List<EntityBean_Oc_Property_Tools_Ice> list=new ArrayList<EntityBean_Oc_Property_Tools_Ice>();
		list=this.getHibernateTemplate().find("from EntityBean_Oc_Property_Tools_Ice where 1=1");
		return list;
	}
	
	@SuppressWarnings("unchecked")
	public List<EntityBean_Oc_Property_Tools_Ice>Find_EntityBean_Oc_Property_Tools_Ice_Is_Active()
	{
		List<EntityBean_Oc_Property_Tools_Ice> list=
			this.getHibernateTemplate().find("from EntityBean_Oc_Property_Tools_Ice where del='OFF'");	
		return list;
	}
	public List<EntityBean_Oc_Property_Tools_Ice> Find_EntityBean_Oc_Property_Tools_Ice_by_property_id(
			Integer id) {
		return this.getHibernateTemplate().find("from EntityBean_Oc_Property_Tools_Ice where del='OFF' and pid="+id);
	}
	

}
